package dd.view;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;

import dd.model.Event;
import dd.model.Model;

public class SelectChoiceFrame extends JFrame {

	private JPanel contentPane;
	private JTextField choiceField;
	private String eventName;
	private int numberOflines;
	Event event;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Model m = Model.getInstance();
					Event e = new Event();
					m.setEvent(e);
					e.setName("who buy");
					SelectChoiceFrame frame = new SelectChoiceFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 * @param event 
	 */
	public SelectChoiceFrame() {
		Model model = Model.getInstance();
		this.event = model.getEvent();
		
		eventName = event.getName();
		
		setTitle("Select Choice Form");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblOpenModePlease = new JLabel("Open mode please enter choice");
		lblOpenModePlease.setBounds(120, 38, 208, 16);
		contentPane.add(lblOpenModePlease);
		
		JLabel lblEnterChoice = new JLabel("Enter Choice:");
		lblEnterChoice.setBounds(23, 98, 105, 16);
		contentPane.add(lblEnterChoice);
		
		choiceField = new JTextField();
		choiceField.setBounds(120, 92, 134, 28);
		contentPane.add(choiceField);
		choiceField.setColumns(10);
		
		JButton btnSubmit = new JButton("Submit");
		btnSubmit.setBounds(295, 205, 117, 29);
		contentPane.add(btnSubmit);
		
		JLabel lblNewLabel = new JLabel(eventName);
		lblNewLabel.setBounds(120, 6, 158, 16);
		contentPane.add(lblNewLabel);
	}

}
